package com.mingmen.supplier.activity;


import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mingmen.supplier.R;
import com.mingmen.supplier.adapter.CanCelOrderAdapter;
import com.mingmen.supplier.adapter.CancelShopDetailAdapter;
import com.mingmen.supplier.adapter.CommodityAdapter;
import com.mingmen.supplier.adapter.MyCommentAdapter;
import com.mingmen.supplier.adapter.PhotoWaiAdapter;
import com.mingmen.supplier.immersionbar.ImmersionBar;
import com.mingmen.supplier.model.CancelModel;
import com.mingmen.supplier.model.MySimpleData;
import com.mingmen.supplier.util.GsonUtil;
import com.mingmen.supplier.util.ScalableCardHelper;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class CanCelShoplActivity extends AppCompatActivity {

    //返回按钮
    @BindView(R.id.text_return)
    TextView textReturn;


    RecyclerView recycle_comment;


    CancelShopDetailAdapter cancelShopDetailAdapter;
    String send_shopStr;
    List<CancelModel.DataBean.BillDetailsBean> dataList = new ArrayList<>();
    @BindView(R.id.linear_return)
    LinearLayout linear_return;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_cancelshopdetail);
        ButterKnife.bind(this);
        ImmersionBar.with(this)
                .statusBarDarkFont(true, 0.2f)
                .init();
        recycle_comment = (RecyclerView) findViewById(R.id.recycle_comment);
        send_shopStr=getIntent().getStringExtra("send_shopStr");
        Log.d("send_shopStr",send_shopStr);

        recycle_comment.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
        cancelShopDetailAdapter = new CancelShopDetailAdapter(this, dataList);
        recycle_comment.setAdapter(cancelShopDetailAdapter);

        CancelModel cancelModel=new CancelModel();
        cancelModel= GsonUtil.GsonToBean(send_shopStr,CancelModel.class);
        dataList.addAll(cancelModel.getData().get(0).getBillDetails());
        cancelShopDetailAdapter.setDataList(dataList);
    }


    @OnClick({R.id.text_return,R.id.linear_return})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.linear_return:
            case R.id.text_return:
                finish();
                break;


        }
    }


}




